Adding a translated attribute to a tag

Attribute translation relies heavily on the ability of the parser in Dreamweaver 3 to ignore server markup. Dreamweaver 3 already ignores the most common kinds of server markup (including ASP, CFML, and PHP) by default; if you are using server markup that has different start and end markers, you must modify the third-party tag database to ensure that your translator works properly. For more information on modifying the third-party tag database, see Chapter 16, "Customizing Dreamweaver," in Using Dreamweaver.

With Dreamweaver handling the preservation of the original server markup, the translator's task is to generate a valid attribute value that can be viewed in the Document window. (Hence, if you are using server markup only for attributes that do not have a user-visible effect, you do not need a translator.)

The translator creates an attribute value that has a visible effect in the Document window by adding a special attribute, mmTranslatedValue, to the tag containing the server markup. The mmTranslatedValue attribute and its value are not visible in the HTML inspector, however, nor are they saved with the document.

The mmTranslatedValue attribute must be unique within the tag. If it is likely that your translator will need to translate more than one attribute in a single tag, you must add a routine in the translator that appends numbers to mmTranslatedValue (for example, mmTranslatedValue1, mmTranslatedValue2, and so on).

The value of the mmTranslatedValue attribute must be a URL-encoded string containing at least one valid attribute/value pair. This means that mmTranslatedValue="src=%22open.jpg%22" is a valid translation for both src="<? if (dayType == weekday) then open.jpg else closed.jpg" ?> and <? if (dayType == weekday) then src="open.jpg" else src="closed.jpg" ?>. mmTranslatedValue="%22open.jpg%22" is not valid for either example because it contains only the value, not the attribute.